<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <canvas id="c" width="300" height="300" style="border: 1px solid #ccc"></canvas>

        <script>
            const cnv = document.getElementById('c')
            const ctx = cnv.getContext('2d')
            ctx.font = '60px Arial'
            // cxt.strokeStyle = 'pink'
            ctx.strokeText('雷猴', 40, 100)

            // 旋转 45°
            ctx.translate(90, -50) //可以通过平移变化旋转中心
            ctx.rotate((45 * Math.PI) / 180)

            // 重新渲染
            ctx.strokeText('雷猴', 40, 100)
        </script>
    </body>
</html>
